<%@ page pageEncoding="UTF-8" trimDirectiveWhitespaces="true"%>
<%@ include file="taglib.jsp"%>
<aside class="main-sidebar">
	<section class="sidebar">
		<div class="user-panel">
			<div class="pull-left info">导航菜单</div>
			<a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button"><span class="sr-only">Toggle navigation</span></a>
		</div>
		<ul class="sidebar-menu">
			<c:if test="${ loginUser.rootMemuItems!=null }">
				<c:forEach var="it" items="${ loginUser.rootMemuItems }">
					<c:set var="it" value="${ it }" scope="request" />
					<jsp:include page="main-sidebar-menu-item.jsp" />
				</c:forEach>
			</c:if>
		</ul>
	</section>
</aside>
<script>
	$(function() {
		// 根据当前URL展开菜单
		var current = null;
		$(".sidebar-menu a").each(function() {
			if ($(this).attr("href") == "${CONTEXT_PATH}${loginUser.currentActionPath}") {
				current = this;
			}
		});
		if (current) {
			$(current).parents("li").addClass("active");
			$(current).parents("ul.treeview-menu").addClass("menu-open");
		}
	});
</script>